style: replace black, isort, flake8 and autoflake with ruff#456
Conversation
|
✅ DCO Check Passed Thanks @schwarbf, all your commits are properly signed off. 🎉 |
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 Require two reviewer for test updatesWonderful, this rule succeeded.When test data is updated, we require two reviewers
|
black and isort by ruff| part_name: str | None = Field(default=None) | ||
| docstring: str | None = Field(default=None) | ||
| sha256: int | None = Field(default=None) | ||
| start_line: int | None = Field(default=None) | ||
| end_line: int | None = Field(default=None) | ||
| end_line_signature: int | None = Field(default=None) |
There was a problem hiding this comment.
Was this suggested by Ruff?
We still support 3.9 (it may change at some point) and the | syntax is only valid from 3.10. We should therefore keep typing.Optional
There was a problem hiding this comment.
Okay I see. It's weird since I had actually set :
[tool.ruff]
target-version = "py39"Anyways, I will revert this part.
There was a problem hiding this comment.
Thanks! However, I've seen that the syntax is still in other places, like in test/test_page_chunker.py
There was a problem hiding this comment.
Can you please check again? I found 2 remaining spots, where the syntax dtype | None was used instead of Optional[dtype]. The respective rule UP045 is also in the ignore list such that no errors are raised in the future.
4c618ea to
85a1889
Compare
|
@ceberam PR should be ready. Let me know if you want me to rebase or merge with |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
@schwarbf sorry for the late reply. Would you mind rebasing to the latest |
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
…aises fewer issues Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
…ff (i.e. no separate [tool.flake8] section Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
…= 120 equals now what was set for the .flake8 settings Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
… one linting check would fail Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
Signed-off-by: Florian Schwarb <florian.schwarb@gmail.com>
7b6da2d to
b60b5c3
Compare
|
@schwarbf I have rebased and force-pushed your commits. I'll add a couple of them to fix some small details and apply a couple of additional style rules. |
Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
d4b6f87 to
a73490d
Compare
@ceberam That's fine thanks. I was going to do it tonight. Seems like we're ready to merge apart from the |
All good @schwarbf , thanks for your contribution! |
This PR aims to close the open issue 453.
I tried to do as little code changes as possible. I did the following:
doclingrepositoryblack,isort,autoflakeandflake8ruff format(formatted approx. 30 files) andruff check --fix(fixed approx. 50 warnings)test/datafrom ruffignorelist that would have affected > 3 changes. Feel free to remove any again to see possible changes.120inpyproject.toml(was120in.flake8file, but88inpyproject.toml)FYI: When checking which commit added
ruffto docling, you can see that 5458a88also changed a significant number of files and added some rules to the
ignorelist.